<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
</head>
<body>
<button id="js2java1">js调用java</button><br>
<button id="js2java2">js调用java(无JavascriptInterface注解)</button>
<script>
function bindClick(id,click)
{
    document.querySelector(id).addEventListener("click",click);
}
//js调用java(有注解)
bindClick("#js2java1",function(){
    window.sqsx.toast(this.innerHTML);
});
//js调用调用java(无注解)
bindClick("#js2java2",function(){
    window.sqsx.cannotCall();
});

function test(islow,param)
{
    console.log("java调用js"+param);
    //低版本回调方案
    if(islow)
    {
        window.sqsx.callback("回调");
    }
    //高版本回调方案
    else
    {
        return "回调";
    }
}
</script>
</body>
</html>